Geoniche: Don't crash on empty input file.
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Dec 2012 20:02:31 +0000 (20:02 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Dec 2012 20:02:31 +0000 (20:02 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4226 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/geoniche.c

index 4e9e0d05917f0b5f7fb1a2cf660fa14d311756c6..1e6246d8e8be8359327f4f7bb8b127bef8fda679 100644 (file)
@@ -203,7 +203,7 @@ geoniche_read_asc(void)
 
   /* Process record 0 */
   pdb_rec = file_in->rec_list;
-  if (strcmp((char*) pdb_rec->data, Rec0Magic)) {
+  if (!pdb_rec || strcmp((char*) pdb_rec->data, Rec0Magic)) {
     fatal(MYNAME ": Bad record 0, not a GeoNiche file.\n");
   }
   pdb_rec = pdb_rec->next;